package com.example.demo2;



public class Test2 {
    public static void main(String[] args) {
        Two<Integer> integerTwo = new Two<>();
        integerTwo.setFan(111);
        fun(integerTwo);

        Two<String> stringTwo = new Two<>();
        stringTwo.setFan("dsadwa");
        fun1(stringTwo);

        Two<Boolean> booleanTwo = new Two<>();
        booleanTwo.setFan(false);
        fun2(booleanTwo);
    }

    public static void fun(Two<? extends Number> two){
        two.AAA();
    }
    public static void fun1(Two<? super String> two){
        two.AAA();
    }
    public static void fun2(Two<? super Boolean> two){
        two.AAA();
    }
}
class Two<T> {
    private T Fan;

    public void AAA() {
        System.out.println("Fan = " + Fan);
    }

    public T getFan() {
        return Fan;
    }

    public void setFan(T fan) {
        Fan = fan;
    }
}